<?php
/**
 * 服务相关接口请求参数验证器
 * 发仔<i@fazi.me> 2018-07-09
 */
namespace app\open\validate;

use app\base\validate\BaseValidate;
class ServiceValidate extends BaseValidate
{
    //验证
    protected $rule = [
        'service_id' =>  'require|integer',
        'service_mode' =>  'require|integer',
        'service_name' =>  'require',
        'link_man' =>  'require',
        'link_phone' =>  'require',
        'address' =>  'require',
    ];

    // 默认值
    protected $default = [
    ];

    protected $message = [
        'fields.isNotEmpty' => '字段不能为空',
        'where_json.isWhereJson' => '不是合法的json字符串',
    ];

    protected $scene = [
        'list' => [ 'fields', 'where_json'],
        'add' => [
            'service_mode','service_name','link_man','link_phone','address'
        ],
        'edit' => [
            'service_id', 'service_mode','service_name','link_man','link_phone','address'
        ],
        'delete' => [ 'ids' ],
    ];

}